package com.lkm.app_ui.help;

import com.lkm.javatool.NumberHelp;

public class LogHelp {

    public static String toString(byte[] s) {
        StringBuilder stringBuilder = new StringBuilder();
        for (byte b : s) {
            stringBuilder.append(" ");
            stringBuilder.append(NumberHelp.bytesToHex(b));
        }
        return stringBuilder.toString();
    }

    public static byte[] toBytes(String s){
            String[] hexs=s.split(" ");
            byte [] byteDatas=new byte[hexs.length];
            for(int i=0;i<hexs.length;i++){
                String hex=hexs[i];
                try{
                    byteDatas[i] = Integer.valueOf(hex, 16).byteValue(); 
                }catch (Exception e) {
                 return null;
                }

            }
           return byteDatas;

    }

    
    public static class Steelyard{

    }

}
